<!--  -->
<template>
    <div>
<nav class="ui inverted attached segment m-pad-tb-null m-opacity m-shadow-small" style="z-index:10;">
    <div class="m-margin-lf-max">
        <div class="ui inverted secondary  menu stackable m-nav  ">
            <h1 class="ui teal header item ">管理后台</h1>
            <router-link class="m-item item m-mobile-hide" to="/admin/blogs"><i class="home icon"></i>博客</router-link>
            <router-link class="m-item item m-mobile-hide" to="/admin/types"><i class="idea icon"></i>分类</router-link>
            <router-link class="m-item item m-mobile-hide" to="/admin/animes"><i class="idea icon"></i>番剧</router-link>
            <router-link class="m-item item m-mobile-hide" to="/index"><i class="block layout icon"></i>首页</router-link>
            <!--导航栏右边菜单-->
            <div class="right menu">
                <div class="ui dropdown item" id="right-menu">
                    <div class="text">
                        <img :src="ImgDomainName+admin.avatar" alt="" class="ui avatar image">
                        <span>{{admin.nickname}}</span>
                    </div>
                    <i class="dropdown icon"></i>
                    <section class="menu">
                        <router-link class="item" to="/admin/inputAbout">个人信息</router-link>
                        <div class="item" @click="logout()">注销</div>
                    </section>
                </div>
            </div>
        </div>
    </div>
</nav>
    </div>
</template>

<script>
export default {
    data () {
        return {
            admin:"",
            ImgDomainName:this.$ImgDomainName
        };
    },
    methods:{
        logout(){
            var _this = this
            setTimeout(function(){
                _this.$store.commit('logout')
                _this.$router.push({path:'/index'})
            },300)
        }
    },
    mounted(){
        $(".ui.dropdown").dropdown()
    },
    destroyed(){
        $(".ui.dropdown").dropdown()
    },
    created(){
        this.admin = JSON.parse(localStorage.getItem('user'))
    }
}

</script>
<style scoped>
</style>